package com.manor.common.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
import com.manor.common.utils.StringUtil;

import java.util.List;

/**

 * @version 1.0
 *
 * @date 2020/4/26  10:06
 */
public class ShortVideoBean {

    /**
     * id : 1
     * uid : 1434
     * title :
     * thumb :
     * video_thumb :
     * href : http://1301315754.vod2.myqcloud.com/d7ad3a40vodcq1301315754/c38b722f5285890801847681154/LJpr2qjLxDYA.mp4
     * voice :
     * length : 0
     * likes : 0
     * comments : 0
     * type : 2
     * isdel : 0
     * status : 1
     * uptime : 1587807675
     * xiajia_reason :
     * lat :
     * lng :
     * city : 深圳市
     * addtime : 1587806996
     * fail_reason :
     * width :
     * height :
     * share_num : 0
     * over_num : 48
     * datetime : 16小时前
     * thumbs : []
     * islike : 0
     * isattent : 0
     * userinfo : {"isauth":"0","id":"1434","user_nickname":"有情有義","avatar":"http://online.shand2
     * .com/admin/20200413/61803888dcfea81c7bf126c00cd9e174.png","avatar_thumb":"http://online.shand2.com/admin/20200413/61803888dcfea81c7bf126c00cd9e174.png","sex":"2","age":20}
     */

    private String id = "";
    private String uid = "";
    private String title = "";
    private String thumb = "";
    private String video_thumb = "";
    private String href = "";
    private String voice = "";
    private String length = "";
    private String likes = "";
    private String comments = "";
    private String type = "";
    private String isdel = "";
    private String status = "";
    private String uptime = "";
    private String xiajia_reason = "";
    private String lat = "";
    private String lng = "";
    private String city = "";
    private String addtime = "";
    private String fail_reason = "";
    private String width = "";
    private String height = "";
    private String share_num = "";
    private String over_num = "";
    private String datetime = "";
    private String islike = "";
    private String isprivate = "";
    private String isattent = "";
    private int curHeight;
    private UserinfoBean userinfo;
    private AdvInfoBean advInfo;
    private List<?> thumbs;
    public int review_status;
    private String share_url = "";
    //广告如下
    private boolean badv;//是否广告
    private boolean isLoad = true;
    private int advType = 0;// 0.没有广告；1.本服务器广告；2.三方广告

    private String adSdkId = "";

    public String getAdSdkId() {
        return adSdkId;
    }

    public void setAdSdkId(String adSdkId) {
        this.adSdkId = adSdkId;
    }

    public final static int REVIEW_STATUS_NOT_REVIEW = 0;
    public final static int REVIEW_STATUS_NORMAL = 1;
    public final static int REVIEW_STATUS_PORN = 2;

    public int getReview_status() {
//        if (data.has("review_status")) {
//            // 如果后台接入了鉴黄功能，需要根据状态来判断要不要播放
//            this.review_status = data.optInt("review_status");
//        } else {
//            // 如果后台没有接入鉴黄功能，视频可以正常播放
//            this.review_status = REVIEW_STATUS_NORMAL;
//        }
        return REVIEW_STATUS_NORMAL;
    }

    public void setReview_status(int review_status) {
        this.review_status = review_status;
    }


    public boolean isLoad() {
        return isLoad;
    }

    public void setLoad(boolean load) {
        isLoad = load;
    }

    public boolean isBadv() {
        if (getAdvType()>0)
            return true;
        return badv;
    }

    public void setBadv(boolean badv) {
        this.badv = badv;
    }


    public int getAdvType() {
        return advType;
    }

    public void setAdvType(int advType) {
        this.advType = advType;
    }

    public String getShare_url() {
        return share_url;
    }

    public void setShare_url(String share_url) {
        this.share_url = share_url;
    }

    public String getId() {
        if (badv){
            return getAdvInfoBean().getId();
        }
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getCurHeight() {
        return curHeight;
    }

    public void setCurHeight(int curHeight) {
        this.curHeight = curHeight;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getIsprivate() {
        return isprivate;
    }

    public boolean isPrivate() {
        return this.isprivate.equals("1");
    }

    public void setIsprivate(String isprivate) {
        this.isprivate = isprivate;
    }

    public String getTitle() {
        if (badv)
            return getAdvInfoBean().getTextcontent();
        if (StringUtil.isEmpty(title))
            return "";
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getThumb() {
        if (badv)
            return getAdvInfoBean().getPiccontent();
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getVideo_thumb() {
        return video_thumb;
    }

    public void setVideo_thumb(String video_thumb) {
        this.video_thumb = video_thumb;
    }

    public String getHref() {
        if (badv)
            return getAdvInfoBean().getVideocontent();
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getVoice() {
        return voice;
    }

    public void setVoice(String voice) {
        this.voice = voice;
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public String getLikes() {
        return likes;
    }

    public void setLikes(String likes) {
        this.likes = likes;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIsdel() {
        return isdel;
    }

    public void setIsdel(String isdel) {
        this.isdel = isdel;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getUptime() {
        return uptime;
    }

    public void setUptime(String uptime) {
        this.uptime = uptime;
    }

    public String getXiajia_reason() {
        return xiajia_reason;
    }

    public void setXiajia_reason(String xiajia_reason) {
        this.xiajia_reason = xiajia_reason;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddtime() {
        return addtime;
    }

    public void setAddtime(String addtime) {
        this.addtime = addtime;
    }

    public String getFail_reason() {
        return fail_reason;
    }

    public void setFail_reason(String fail_reason) {
        this.fail_reason = fail_reason;
    }

    public String getWidth() {
        if (badv){
            return getAdvInfoBean().getWidth();
        }
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getHeight() {
        if (badv){
            return getAdvInfoBean().getHeight();
        }
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    @JSONField(name ="shares")
    @SerializedName(value = "shares")
    public String getShare_num() {
        return share_num;
    }

    @JSONField(name ="shares")
    @SerializedName(value = "shares")
    public void setShare_num(String share_num) {
        this.share_num = share_num;
    }

    public String getOver_num() {
        return over_num;
    }

    public void setOver_num(String over_num) {
        this.over_num = over_num;
    }

    public String getDatetime() {
        return datetime;
    }

    public void setDatetime(String datetime) {
        this.datetime = datetime;
    }

    public String getIslike() {
        if (islike.equals("true"))
            return "1";
        return islike;
    }

    public void setIslike(String islike) {
        this.islike = islike;
    }

    public String getIsattent() {
        if (isattent.equals("isattent"))
            return "1";
        return isattent;
    }

    public void setIsattent(String isattent) {
        this.isattent = isattent;
    }

    public UserinfoBean getUserinfo() {
        return userinfo;
    }

    public void setUserinfo(UserinfoBean userinfo) {
        this.userinfo = userinfo;
    }

    public AdvInfoBean getAdvInfoBean() {
        if (advInfo == null)
            return new AdvInfoBean();
        return advInfo;
    }

    public void setAdvInfoBean(AdvInfoBean advInfoBean) {
        this.advInfo = advInfoBean;
    }

    public List<?> getThumbs() {
        return thumbs;
    }

    public void setThumbs(List<?> thumbs) {
        this.thumbs = thumbs;
    }

    public static class UserinfoBean {
        /**
         * isauth : 0
         * id : 1434
         * user_nickname : 有情有義
         * avatar : http://online.shand2.com/admin/20200413/61803888dcfea81c7bf126c00cd9e174.png
         * avatar_thumb : http://online.shand2.com/admin/20200413/61803888dcfea81c7bf126c00cd9e174.png
         * sex : 2
         * age : 20
         */

        private String isauth;
        private String id;
        private String user_nickname;
        private String avatar;
        private String avatar_thumb;
        private String sex;
        private int age;
        private String isvoice;
        private String voice_value;
        private String isvideo;
        private String video_value;

        public String getIsvoice() {
            if (StringUtil.isEmpty(isvoice))
                return "";
            return isvoice;
        }

        public void setIsvoice(String isvoice) {
            this.isvoice = isvoice;
        }

        public String getVoice_value() {
            return voice_value;
        }

        public void setVoice_value(String voice_value) {
            this.voice_value = voice_value;
        }

        public String getIsvideo() {
            if (StringUtil.isEmpty(isvideo))
                return "";
            return isvideo;
        }

        public void setIsvideo(String isvideo) {
            this.isvideo = isvideo;
        }

        public String getVideo_value() {
            return video_value;
        }

        public void setVideo_value(String video_value) {
            this.video_value = video_value;
        }

        public String getIsauth() {
            return isauth;
        }

        public void setIsauth(String isauth) {
            this.isauth = isauth;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getUser_nickname() {
            if (StringUtil.isEmpty(user_nickname)){
                return "";
            }
            return user_nickname;
        }

        public void setUser_nickname(String user_nickname) {
            this.user_nickname = user_nickname;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getAvatar_thumb() {
            return avatar_thumb;
        }

        public void setAvatar_thumb(String avatar_thumb) {
            this.avatar_thumb = avatar_thumb;
        }

        public String getSex() {
            return sex;
        }

        public void setSex(String sex) {
            this.sex = sex;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }
    }


    public static class AdvInfoBean{
        public String advname = "";//广告名称
        public String height = "";//
        public String id = "";
        public String kindtype = "";//广告类型
        public String piccontent = "";//图片内容
        public String textcontent = "";//文字内容
        public String videocontent = "";//视频内容
        public String width = "";//宽度
        public String aurl = "";//web

        public String getAurl() {
            return aurl;
        }

        public void setAurl(String aurl) {
            this.aurl = aurl;
        }

        public String getAdvname() {
            return advname;
        }

        public void setAdvname(String advname) {
            this.advname = advname;
        }

        public String getHeight() {
            return height;
        }

        public void setHeight(String height) {
            this.height = height;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getKindtype() {
            return kindtype;
        }

        public void setKindtype(String kindtype) {
            this.kindtype = kindtype;
        }

        public String getPiccontent() {
            return piccontent;
        }

        public void setPiccontent(String piccontent) {
            this.piccontent = piccontent;
        }

        public String getTextcontent() {
            return textcontent;
        }

        public void setTextcontent(String textcontent) {
            this.textcontent = textcontent;
        }

        public String getVideocontent() {
            return videocontent;
        }

        public void setVideocontent(String videocontent) {
            this.videocontent = videocontent;
        }

        public String getWidth() {
            return width;
        }

        public void setWidth(String width) {
            this.width = width;
        }
    }

}
